From fe951facbac1b88c9c2e5cd1c52e75797d562cc5 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Tue, 28 Nov 2017 12:11:41 -0700 Subject: [PATCH] script windows release process. --- appveyor.yml | 36 +----------------------- tools/make_windows_release.ps1 | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 35 deletions(-) create mode 100755 tools/make_windows_release.ps1 diff --git a/appveyor.yml b/appveyor.yml index 9e059546e..1eb200db4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,41 +39,7 @@ build_script: { Get-Location qmake -query - # mimic creator shadow build to match Inno setup file - $gpsbabel_build_dir = "build-GPSBabel-Desktop_Qt_5_5_1_Mingw_32bit-Release" - $gui_build_dir = "build-app-Desktop_Qt_5_5_1_MinGW_32bit-Release" - # make sure we are staring with a clean build directory - Remove-Item "..\$($gpsbabel_build_dir)" -Recurse -ErrorAction Ignore - New-Item "..\$($gpsbabel_build_dir)" -type directory -force - cd "..\$($gpsbabel_build_dir)" - qmake ..\gpsbabel\GPSBabel.pro -spec win32-g++ - mingw32-make qmake_all - mingw32-make - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - # copy GPSBabel.exe for use by test_script - Remove-Item ..\gpsbabel\release -Recurse -ErrorAction Ignore - New-Item ..\gpsbabel\release -type directory -force - Copy-Item release\GPSBabel.exe ..\gpsbabel\release\GPSBabel.exe - cd ..\gpsbabel - # make sure we are staring with a clean build directory - Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore - New-Item "$($gui_build_dir)" -type directory -force - cd "$($gui_build_dir)" - qmake ..\gui\app.pro -spec win32-g++ - mingw32-make qmake_all - mingw32-make - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - lupdate ..\gui\app.pro - lrelease ..\gui\app.pro - # windeployqt in 5.5.1 suffers from bug - # https://bugreports.qt.io/browser/QTBUG-48946 - # which trashes the translations. Work around - # by using the next version of windeployqt which had this - # bug fixed. - # use --plugindir option to locate the plugins. - C:\Qt\5.6\mingw49_32\bin\windeployqt.exe --verbose 10 --plugindir release\plugins release\GPSBabelFE.exe - & 'C:\Program Files (x86)\Inno Setup 5\ISCC.exe' ..\gui\setup.iss - cd .. + & ".\tools\make_windows_release.ps1" $sha=(git rev-parse --short HEAD) Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Setup.exe" } Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabelTest-$($env:APPVEYOR_BUILD_VERSION)-$($sha)-Manifest.txt" } diff --git a/tools/make_windows_release.ps1 b/tools/make_windows_release.ps1 new file mode 100755 index 000000000..553a8b990 --- /dev/null +++ b/tools/make_windows_release.ps1 @@ -0,0 +1,51 @@ +# Script to build and create windows installer. +# +# Run this from a Qt Desktop command window that has the Qt and mingw compiler paths set up, +# such as the one Qt Creator will put on the start menu. +# For example, to run overriding the default locations of windeployqt and ISSC: +# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -windeployqt "C:\Qt\5.6.3\mingw49_32\bin\windeployqt.exe" -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" +# +# Be aware this script is used by appveyor.yml +# +# The defaults should be set for appveyor builds. +Param( + $windeployqt = "C:\Qt\5.6\mingw49_32\bin\windeployqt.exe", + $iscc = "C:\Program Files (x86)\Inno Setup 5\ISCC.exe", + $gpsbabel_build_dir = "build-GPSBabel-Desktop_Qt_5_5_1_Mingw_32bit-Release", + $gui_build_dir = "build-app-Desktop_Qt_5_5_1_MinGW_32bit-Release" +) +# verify we are in the top of the gpsbabel clone +Get-Item tools/make_windows_release.ps1 -ErrorAction Stop +# mimic creator shadow build to match Inno setup file +# make sure we are staring with a clean build directory +Remove-Item "..\$($gpsbabel_build_dir)" -Recurse -ErrorAction Ignore +New-Item "..\$($gpsbabel_build_dir)" -type directory -force +cd "..\$($gpsbabel_build_dir)" +qmake ..\gpsbabel\GPSBabel.pro -spec win32-g++ +mingw32-make qmake_all +mingw32-make +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +# copy GPSBabel.exe for use by test_script +Remove-Item ..\gpsbabel\release -Recurse -ErrorAction Ignore +New-Item ..\gpsbabel\release -type directory -force +Copy-Item release\GPSBabel.exe ..\gpsbabel\release\GPSBabel.exe +cd ..\gpsbabel +# make sure we are staring with a clean build directory +Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore +New-Item "$($gui_build_dir)" -type directory -force +cd "$($gui_build_dir)" +qmake ..\gui\app.pro -spec win32-g++ +mingw32-make qmake_all +mingw32-make +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +lupdate ..\gui\app.pro +lrelease ..\gui\app.pro +# windeployqt in 5.5.1 suffers from bug +# https://bugreports.qt.io/browser/QTBUG-48946 +# which trashes the translations. Work around +# by using the next version of windeployqt which had this +# bug fixed. +# use --plugindir option to locate the plugins. +& "$($windeployqt)" --verbose 10 --plugindir release\plugins release\GPSBabelFE.exe +& "$($iscc)" ..\gui\setup.iss +cd .. -- 2.30.2